<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>高校列表</title>
{#  <link href="{{ url_for('static',filename='layui/css/layui.css') }}" rel="stylesheet">#}
    <link rel="stylesheet" href="{{ url_for('static',filename='editormd/css/editormd.css') }}"/>
    <link  href="{{ url_for('static',filename="css/bootstrap.min.css") }}" rel="stylesheet">
{#<link href="{{ url_for('static',filename="css/materialdesignicons.min.css") }}" rel="stylesheet">#}
{#<link href="{{ url_for('static',filename="css/style.min.css") }}" rel="stylesheet">#}
{#    <link rel="stylesheet" href="//res.layui.com/layui/dist/css/layui.css"  media="all">#}
</head>
<body>
 <div class="form-group">
              <label class="col-xs-2" for="example-select">选择文章分类</label>
              <div class="col-xs-3">
                <select class="form-control" id="select" name="example-select" size="1">
                  <option value="0">请选择</option>
                    {% for i in type %}
                  <option value={{ i.id }}>{{ i.name }}</option>
                    {% endfor %}
                </select>
              </div>
            </div>
<div class="form-group">
              <label class="col-xs-2" for="example-text-input">文章题目</label>
              <div class="col-xs-4">
                <input class="form-control" type="text" id="text-input" name="example-text-input" placeholder="文本..">
              </div>
            </div>
 <div class="form-group">
              <label class="col-xs-2" for="example-textarea-input">文章简介</label>
              <div class="col-xs-6">
                <textarea class="form-control" id="textarea-input" name="example-textarea-input" rows="6" placeholder="内容.."></textarea>
              </div>
            </div>
<div id="fancy-editormd" class="editormd">
    <textarea id="body" name="body" required style="display: none"></textarea>

</div>
<button onclick="tijiao()">提交</button>
<script type="text/javascript" src="{{ url_for('static',filename='jquery/jquery-3.5.1.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static',filename='layui/layui.js') }}"></script>
<script src="{{ url_for('static',filename='editormd/editormd.min.js') }}"></script>
<script type="text/html" id="toolbar">
<div class="layui-container">

</div>

</script>
<script>
$(function () {
        editormd("fancy-editormd", {
            // width: "100%", 请不要添加
            height: 640,
            syncScrolling: "single",
            path: "{{ url_for('static',filename='editormd/lib/') }}",
            saveHTMLToTextarea : true
        });
    });
  function tijiao(){
        $.ajax({
            url:"/backstage/Addarticle",
            method:"post",
            data:{
                text:$(".editormd-html-textarea").text(),
                type:$("#select").val(),
                title:$("#text-input").val(),
                describe:$("#textarea-input").val()
            },
            success:{
                {#alert( "chenggong")#}
            }

            }
        )
    }
</script>
</body>
</html>